from django.urls import path, include
from rest_framework.routers import DefaultRouter

from orders.views import OrderSettlementView, SaveOrderView, GoodsDetailOrderView, \
    CouponView, GetCouponsView, GetordersView, GetCourierCompanyView, GoodsReturnView, GetReturnView, LogisticsView, \
    TakeGoods, DiscountPackageView, ReasonView, Order_CouponViewSet, Order_Freight, PackageListView

router = DefaultRouter()
# router.register(r'ordercoupon', Order_CouponViewSet,base_name='order')  # 查询当前商品列表可用优惠券列表

urlpatterns = [
    path('', include(router.urls)),
    path('orders/carts/', OrderSettlementView.as_view(), name='cartorder'),  # 购物车确认订单
    path('orders/saveorder_carts/', SaveOrderView.as_view(), name='saveorder'),  # 购物车生成订单
    path('orders/saveorder_goodsdetail/', GoodsDetailOrderView.as_view(), name='goodsdetail_saveorder'),  # 商品详情页生成订单
    path('orders/saveorder_discountpackage/', DiscountPackageView.as_view(), name='saveorder_discountpackage'),
    # 商品详情页生成订单
    path('orders/save_coupon/', CouponView.as_view(), name='discountcoupon'),  # 客户领取优惠券
    path('orders/get_coupon/<int:status>/', GetCouponsView.as_view(), name='getcoupons'),  # 客户查询优惠券
    path('orders/get_orders/<int:status>/', GetordersView.as_view(), name='getorders'),  # 客户查询已生成订单
    path('orders/get_orders/', GetordersView.as_view(), name='get_coupons'),  # 客户删除，取消已生成订单
    path('orders/get_courier_company/', GetCourierCompanyView.as_view(), name='getcouriercompany'),  # 客户查询可用快递公司
    path('orders/is_return/', GoodsReturnView.as_view()),  # 客户退换货申请
    path('orders/get_return/', GetReturnView.as_view()),  # 客户退换货查询
    path('orders/post_logistics/', LogisticsView.as_view()),  # 客户填充退货单号
    path('orders/take_goods/', TakeGoods.as_view()),  # 客户主动收货或者延长收货申请
    path('orders/reason/', ReasonView.as_view()),  # 退换货原因
    path('orders/ordercoupon/', Order_CouponViewSet.as_view()),  # 适用于该商品列表的优惠券查询
    path('orders/orderfreight/', Order_Freight.as_view()),  # 商品列表对应快递费
    path('orders/packagelist/', PackageListView.as_view()),  # 查询商品属性列表详情

    # path('orders/is_return_test/', GoodsReturnView_test.as_view()),  # 客户退换货申请
]
